package GUI.view.outlook;

import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.ListSelectionModel;

public class FreeOutlookList extends JList {

    private FreeOutlookBar bar = null;
    private final DefaultListModel model = new DefaultListModel();

    public FreeOutlookList(final FreeOutlookBar bar) {
        super();
        this.bar = bar;
        init();
        this.setModel(model);
    }

    private void init() {
        this.setCellRenderer(new FreeOutlookListRenderer(this));
        this.setFont(FreeUtil.FONT_12_BOLD);
        this.setForeground(FreeUtil.OUTLOOK_TEXT_COLOR);
        this.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
       /* this.addVisibleFilter(new VisibleFilter() {

            @Override
			public boolean isVisible(final Element element) {
                return element instanceof FreeNode;
            }
        });*/
    }

    public FreeOutlookBar getFreeOutlookBar() {
        return bar;
    }
    
   
	public DefaultListModel getOutlookListModel(){
    	return model;
    }
}
